package com.example.wechattakeaway.service;

import com.example.wechattakeaway.entity.SysUser;
import com.example.wechattakeaway.form.userform.ChangePwdForm;
import com.example.wechattakeaway.form.userform.InsertUserForm;
import com.example.wechattakeaway.form.userform.LoginForm;
import com.example.wechattakeaway.form.userform.UpdateUserForm;
import com.example.wechattakeaway.vo.ResultVO;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;

@Service
@Repository
public interface UserService {

    /*
    用户注册
    @param InsertUserForm
    @return null
     */
    ResultVO UserRegister(InsertUserForm insertUserForm);

    /*
    用户更新
    @param UpdateUserForm
    @return null
     */
    ResultVO UpdateUser(UpdateUserForm updateUserForm);

    /*
    用户更改密码
    @param ChangePwdForm
    @return null;
     */
    ResultVO UserChangerPwd(ChangePwdForm changePwdForm);

    /*
    更新用户角色
    @param userRole,sysuserId
    @return null
     */
    ResultVO UpdateUserRole(Integer userRole,Integer sysuserId);

    /*
    用户尝试登陆
    @param LoginForm
    @return LoginVo
     */
    ResultVO UserLogin(LoginForm loginForm);

    /*
    测试获取在线用户
    @param null
    @return SysUser
     */
    SysUser getCurrentUser();

    /*
    用户退出登录
    @param null
    @return
     */
    ResultVO UserLoginOut();

    /*
    根据id查询用户信息
    @param sysuserId
    @return SysUser
     */
    ResultVO SelectUserById(Integer sysuserId);

    /*
    测试查询所有的用户
    @param null
    @return List<SysUser>
     */
    ResultVO SelectAllUser(Integer pageNum);

    /*
    根据id删除用户
    @param sysuserId
    @return null
     */
    ResultVO DeleteUserById(String sysuserName);

    /*
    通过手机号发送验证码，让用户接受
    @param userPhone
    @return null
     */
    ResultVO GetPhoneCode(String userPhone);

    /*
    通过手机号和验证码，校验当前用户
    @param userPhone,code
    @return null
     */
    ResultVO CheckPhoneCode(String userPhone,String code);

    /*
    通过用户名查询用户信息
    @param sysuserName
    @return SysUser
     */
    ResultVO SelectUserByName(String sysuserName);

}
